﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title></title>
<script type="text/javascript" src="../../_data/SysConfig.js"></script>
<script type="text/javascript" src="../../_libs/jquery-min.js"></script>
<script type="text/javascript" src="../../_libs/jquery.jtemplates.js"></script>
<script type="text/javascript" src="../../scripts/jumbotcms.js?v4"></script>
<link type="text/css" rel="stylesheet" href="../../style/global.css" />
<script type="text/javascript" src="../../admin/otherpage/styles/common.js"></script>
<link type="text/css" rel="stylesheet" href="../../admin/otherpage/styles/common.css" />
<script type="text/javascript">
var pagesize=15;
var page=thispage();
$(document).ready(function(){
	ajaxList(page);
});
function ajaxList(currentpage)
{
	if(currentpage!=null) page=currentpage;
	top.JumbotCms.Loading.show("正在加载数据,请等待...");
	$.ajax({
		type:		"get",
		dataType:	"json",
		data:		"page="+currentpage+"&pagesize="+pagesize+"&time="+(new Date().getTime()),
		url:		"ajax.aspx?oper=ajaxGetList",
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Loading.hide();
				$("#ajaxList").setTemplateElement("tplList", null, {filter_data: true});
				$("#ajaxList").processTemplate(d);
				$("#ajaxPageBar").html(d.pagerbar);
				break;
			}
		}
	});
}
function ajaxCheck(id){
	top.JumbotCms.Loading.show("正在处理...");
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=check&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				top.JumbotCms.Alert(d.returnval, "1");
				ajaxList(page);
				break;
			}
		}
	});
}
function ajaxDel(id){
	$.ajax({
		type:		"post",
		dataType:	"json",
		data:		"id="+id,
		url:		"ajax.aspx?oper=ajaxDel&time="+(new Date().getTime()),
		error:		function(XmlHttpRequest,textStatus, errorThrown){top.JumbotCms.Loading.hide();alert(XmlHttpRequest.responseText); },
		success:	function(d){
			switch (d.result)
			{
			case '-1':
				top.JumbotCms.Alert(d.returnval, "0", "top.window.location='" + site.Dir + "admin/login.htm';");
				break;
			case '0':
				top.JumbotCms.Alert(d.returnval, "0");
				break;
			case '1':
				ajaxList(page);
				break;
			}
		}
	});
}
    </script>

</head>
<body>
    <div class="topnav">
        <span class="preload1"></span><span class="preload2"></span>
        <ul id="topnavbar">
        </ul>

        <script>
	topnavbarStuHover();
        </script>
    </div>
<textarea id="tplList" style="display:none">
<table class="listtable" cellspacing="0" cellpadding="0" border="0" style="width:100%;border-collapse:collapse;">
	<tr>
		<th scope="col" style="width:40px;">ID</th>
		<th scope="col" style="width:100px;">申请人</th>
		<th scope="col" width="*">详细信息</th>
		<th scope="col" style="width:90px;">申请日期</th>
		<th scope="col" style="width:65px;">状态</th>
		<th scope="col" style="width:120px;">操作</th>
	</tr>
	{#foreach $T.table as record}
	<tr onMouseOver="this.style.backgroundColor='F3F7FF'" onMouseOut="this.style.backgroundColor='FFFFFF'">
		<td align="center">{$T.record.id}</td>
		<td align="center"><a href="javascript:void(0);" onclick="top.JumbotCms.Popup.show(site.Dir + 'admin/user/preview.aspx?id={$T.record.userid}',-1,-1,true)">{$T.record.username}</a></td>
		<td align="center"><a>{$T.record.applyinfo}</a></td>
		<td align="left">{formatDate($T.record.applytime,"yyyy-MM-dd")}</td>
		<td align="center">
			{#if $T.record.checked == "1"}
			已受理
			{#else}
			<font color='red'>未受理</font>
			{#/if}
		</td>
		<td align="center">
			{#if $T.record.checked == "0"}
			<a href="javascript:void(0);" onclick="top.JumbotCms.Confirm('确定要作废此申请?', 'IframeOper.ajaxDel({$T.record.id})');">作废申请</a>
			{#if $T.record.applytype == "1"}
           		<a href="javascript:void(0);" onclick="top.JumbotCms.Confirm('你确定立即将用户升级为'+ site.WriterItem +'吗?', 'IframeOper.ajaxCheck({$T.record.id})');">审核通过</a>
			{#/if}
			{#if $T.record.applytype == "2"}
           		<a href="javascript:void(0);" onclick="top.JumbotCms.Confirm('你确定已收到汇款/转账，立即增加点数吗?', 'IframeOper.ajaxCheck({$T.record.id})');">增加点数</a>
			{#/if}
			{#if $T.record.applytype == "3"}
           		<a href="javascript:void(0);" onclick="top.JumbotCms.Confirm('你确定已收到汇款/转账，立即开通VIP服务吗?', 'IframeOper.ajaxCheck({$T.record.id})');">开通服务</a>
			{#/if}
			{#if $T.record.applytype == "4"}
           		<a href="javascript:void(0);" onclick="top.JumbotCms.Confirm('你确定已汇款/转账给用户，立即扣除积分吗?', 'IframeOper.ajaxCheck({$T.record.id})');">扣除积分</a>
			{#/if}
			{#else}
			<font color='#cccccc'>作废申请</font>
			<font color='#cccccc'>处理完毕</font>
			{#/if}
		</td>
	</tr>
	{#/for}
</table>
</textarea>
    <div id="ajaxList"></div>
    <div id="ajaxPageBar" class="pages"></div>
</body>
</html>
